import { getRoutersByModules, sortRoutesByOrder } from 'vue3-common/utils/routerUtil'
import Layout from '@/layout/index.vue'
import { menuMeta } from '@/views/meta'

const modules = {
  ...import.meta.glob('@/views/record/**/*.vue'),
  ...import.meta.glob('@/views/stats/**/*.vue'),
  ...import.meta.glob('@/views/moment/**/*.vue'),
  ...import.meta.glob('@/views/profile/**/*.vue')
}

const menuRoutes = getRoutersByModules(modules, Layout, menuMeta)

export default sortRoutesByOrder(menuRoutes)
